package net.huashitong.taskjob.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;
import net.huashitong.taskjob.entity.TaskMethod;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class TaskMethodDao extends StringDao<TaskMethod> {

    /**
     * 所有督查手段
     * @return
     */
    public List<TaskMethod> getAllMethon()
    {
        GenericQuery query = createQuery("t");
        return query.listResult();
    }

    public TaskMethod getMethon(String method)
    {
        GenericQuery query =createQuery("t");
        query.append("and t.methodCode=:methodCode").setParam("methodCode",method);
        return query.singleResult();
    }

}